<script>
import { mapGetters } from "vuex";

export default {
  computed: {
    ...mapGetters(["networkType", "token"]),
  },
  watch: {
    networkType(type) {
      if (type == "none")
        uni.$u.throttle(this.$reLaunch("/pages/common/none"), 1000);
    },
  },
  onLaunch() {
    this.$store.dispatch("getSystem");
    this.$store.dispatch("checkNetwork");
    this.$store.dispatch("getLocation");

    if (this.token) {
      this.$store.dispatch("getUserInfo");
      this.$store.dispatch("getAddress");
    }
  },
};
</script>

<style lang="scss">
/*每个页面公共css */
@import "uni.scss";
@import "@/uni_modules/uview-ui/index.scss";
@import "./static/style/common.scss";
@import "./static/style/flex.scss";
</style>
